
import 'package:flutter/material.dart';
import 'package:flutterlib/common/datacenter/config_data_center.dart';
import 'package:flutterlib/common/datacenter/user_center.dart';
import 'package:flutterlib/common/net/dao_result.dart';
import 'package:flutterlib/common/net/retrofit/interest_api.dart';
import 'package:flutterlib/common/net/retrofit/post_api.dart';
import 'package:flutterlib/common/style/quhui_style.dart';
import 'package:flutterlib/model/post/post_bean.dart';
import 'package:flutterlib/widgets/bussiness/post/interest_list_item.dart';
import 'package:flutterlib/widgets/bussiness/post/post_list_item.dart';
import 'package:flutterlib/widgets/pull/nested/simple_pull_load_manger.dart';
import 'package:flutterlib/widgets/pull/nested/simple_pull_load_page_widget.dart';

///type = 0 获取我的或者是传入userid的兴趣
///type = 1 获取全部兴趣
abstract class InterestListWidgetPage extends StatefulWidget {

  InterestListWidgetPage({Key key})
      : super(key: key);

  @override
  InterestListWidgetPageState createState();
}

///页面 KeepAlive ，同时支持 动画Ticker
abstract class InterestListWidgetPageState<T extends InterestListWidgetPage> extends State<T>
    with TickerProviderStateMixin {
  SimplePullLoadManger manger;

  ///滑动监听
  final ScrollController scrollController = new ScrollController();

  getDataLogic(int page);

  Widget renderItem(index, interest);


  @override
  void initState() {
    super.initState();
    manger = SimplePullLoadManger(
        getDataLogic: getDataLogic,
        renderItem: renderItem,
      enablePullDown: false,
      enablePullUp: false

        );
  }

  @override
  Widget build(BuildContext context) {
    return SimplePullLoadWidget(
      pullLoadManger: manger,
    );
  }
}
